<?php
ini_set('date.timezone','Asia/Shanghai');
echo "本地服务器时间戳\r\n";
echo time();
$content = file_get_contents('http://quan.suning.com/getSysTime.do');
$content = json_decode($content,true);

if (json_last_error() != JSON_ERROR_NONE) {
            return false;
}

echo "\r\n远程服务器时间\r\n";
echo $content['sysTime2'];
echo "\r\n远程服务器时间戳\r\n";
echo strtotime($content['sysTime2']);
if(isset($argv[1]) && is_numeric($argv[1]))
{
	echo "\r\n运算后的时间戳\r\n";
	echo strtotime($content['sysTime2'])+ $argv[1];
}

if(isset($argv[1]) && $argv[1] == 'date' && isset($argv[2]))
{
	echo "\r\n运算后的时间戳\r\n";
	echo date('Ymd H:i:s',$argv[2]);
}
$file = __DIR__.'/temp/sj.temp';
file_put_contents($file,strtotime($content['sysTime2']));
$fileCommon = "clip < ".$file;
exec($fileCommon);
